package jsu.xxy.coffee3.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jsu.xxy.coffee3.domain.RegisterRequest;
import jsu.xxy.coffee3.domain.Staffs;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

/**
* @author 张从轩
* @description 针对表【staffs】的数据库操作Mapper
* @createDate 2023-06-03 04:07:54
* @Entity jsu.xxy.coffee3.domain.Staffs
*/
@Mapper
public interface StaffsMapper extends BaseMapper<Staffs> {
    @Select("select * from staffs where phonenumber = #{phone} and password = #{password} and position = #{position}")
    Staffs searchBySphone(@Param("phone") String phone , @Param("password") String password , @Param("position") Integer position);
//    @Insert("insert into staffs (name ,phonenumber , gender , birthday position,password,status) values (name ,phonenumber , gender , birthday position,password,status);")

    @Update("update staffs set name = #{name} , phonenumber=#{phonenumber},gender=#{gender},birthday =#{birthday},position=#{position},status = #{status} where staffid=#{staffid}")
    public int update(Staffs staffs);
    @Delete("delete from staffs where staffid = #{id}")
    public int deleteByID(@Param("id") int id);

//员工请求处理模块
    int insertNoId(RegisterRequest registerRequest);

}
